<?php

require_once 'class.EvtFactory.php';
require_once 'inc.utils.php';
$t = new EvtFactory();
$SPOST = $_REQUEST;
//ini_set('display_errors', 1);
//ini_set('log_errors', 1);
//ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
//error_reporting(E_ALL);

foreach ($t->getAllEventIds() as $evt) {
    if ($SPOST['evt_'.$evt['id']] == 1) {
        $evtList[] = $evt['id'];
    }
}

$ret = $t->getEventRepresentation($evtList);
if (isset($ret))
    jsonEncodeArray($ret);
?>